package logmanager.view;

import logmanager.proxy.ServerLogManager;
import logmanager.proxy.ServerLogManagerServiceLocator;

public class Test {

	public Test() {
		if (System.getSecurityManager() == null)
            System.setProperty("java.security.policy", "allpolicy.txt");
		ServerLogManagerServiceLocator sl = new ServerLogManagerServiceLocator();
		sl.setConnectionParams("localhost", "5050");
		//System.setSecurityManager(new RMISecurityManager());
		try {
			ServerLogManager sm = sl.getServerLogManager();
			sm.connect();
	//		sm.setProperties("localhost", "1099", "IDys");
		//	sm.setProperties("localhost", "1099", "IDys");
		//	System.out.println("bien");
		//	sm.addLogJobByName("sessions.log");
		//	sm.removeLog(0);
		//	sm.addLogJobByName("ibou.log");
			System.out.println("bien : " + sm.getSize() + " ");
		//	sm.setReadSizeByName("sessions.log", 10);
		//	sm.getNextData(0);
		//	Bloc b = (Bloc)sm.getData(0);
		//	System.out.println(b.getTuples().length);
		//	sm.getNextData(0);
		/*	for (int i = 0; i < b.getSize(); i++) {
				for (int j = 0; j < b.getTuples()[i].getSize(); j++) {
					System.out.print(b.getTuples()[i].getElem()[j] + " ");
				}
				System.out.println();
			}*/
			
		} catch (Exception e) {
			e.printStackTrace();
			//System.out.println(e.getMessage());
		}
	}
	
	public void print(String dataSource, String [][]data){
		System.out.println(dataSource + " :");
		for (int i = 0; i < data.length; i++) {
			for (int j = 0; j < data[i].length; j++) {
				System.out.print(" " + data[i][j]);
			}
			System.out.println();
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new Test();
	}

}
